/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Modelos;

import Entidades.TipoLicencia;
import java.util.List;
import javax.swing.DefaultComboBoxModel;

/**
 *
 * @author diego
 */
public class ModeloComboTipoLicencia extends DefaultComboBoxModel {

    public void addElement(List<TipoLicencia> tipol) {
        super.addElement("Seleccione tipo");
        for (TipoLicencia tl : tipol) {
            super.addElement(tl); //To change body of generated methods, choose Tools | Templates.
        }
    }

    @Override
    public Object getSelectedItem() {
        if (super.getSelectedItem() instanceof String) {
            return "Seleccione tipo";
        }
        return (TipoLicencia) super.getSelectedItem(); //To change body of generated methods, choose Tools | Templates.
    }
}
